import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            name: 'UserLogin',
            component: resolve => require(['@/views/UserLogin'], resolve),
            meta: {
                requireAuth: false
            }
        },
        {
            path: '/index',
            name: 'HomePage',
            component: resolve => require(['@/views/HomePage'], resolve),
            meta: {
                requireAuth: true
            },
            children: [
                // 首页
                {
                    path: '',
                    name: 'HelloWorld',
                    component: resolve => require(['@/pages/HelloWorld'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // css初始化
                {
                    path: 'CssInit',
                    name: 'CssInit',
                    component: resolve => require(['@/pages/CssInit'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // css基础
                {
                    path: 'CssBasic',
                    name: 'CssBasic',
                    component: resolve => require(['@/pages/CssBasic'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // flex布局
                {
                    path: 'CssFlex',
                    name: 'CssFlex',
                    component: resolve => require(['@/pages/CssFlex'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // js基础
                {
                    path: 'JsBasic',
                    name: 'JsBasic',
                    component: resolve => require(['@/pages/JsBasic'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // js正则
                {
                    path: 'RegExp',
                    name: 'RegExp',
                    component: resolve => require(['@/pages/RegExp'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // js数组
                {
                    path: 'ArrayData',
                    name: 'ArrayData',
                    component: resolve => require(['@/pages/ArrayData'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // js对象
                {
                    path: 'JsonData',
                    name: 'JsonData',
                    component: resolve => require(['@/pages/JsonData'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // vue规范
                {
                    path: 'VueInit',
                    name: 'VueInit',
                    component: resolve => require(['@/pages/VueInit'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // vue常用函数
                {
                    path: 'VueFunction',
                    name: 'VueFunction',
                    component: resolve => require(['@/pages/VueFunction'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // 路由相关
                {
                    path: 'VueRouter',
                    name: 'VueRouter',
                    component: resolve => require(['@/pages/VueRouter'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // Vuex
                {
                    path: 'VueStore',
                    name: 'VueStore',
                    component: resolve => require(['@/pages/VueStore'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // vue.config.js
                {
                    path: 'VueConfig',
                    name: 'VueConfig',
                    component: resolve => require(['@/pages/VueConfig'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // git相关
                {
                    path: 'GitCode',
                    name: 'GitCode',
                    component: resolve => require(['@/pages/GitCode'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // scss
                {
                    path: 'VueScss',
                    name: 'VueScss',
                    component: resolve => require(['@/pages/VueScss'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // axios
                {
                    path: 'VueAxios',
                    name: 'VueAxios',
                    component: resolve => require(['@/pages/VueAxios'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // esLint
                {
                    path: 'VueEslint',
                    name: 'VueEslint',
                    component: resolve => require(['@/pages/VueEslint'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueVw
                {
                    path: 'VueVw',
                    name: 'VueVw',
                    component: resolve => require(['@/pages/VueVw'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueRem
                {
                    path: 'VueRem',
                    name: 'VueRem',
                    component: resolve => require(['@/pages/VueRem'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueI18n
                {
                    path: 'VueI18n',
                    name: 'VueI18n',
                    component: resolve => require(['@/pages/VueI18n'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // npm/yarn
                {
                    path: 'NpmYarn',
                    name: 'NpmYarn',
                    component: resolve => require(['@/pages/NpmYarn'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueSkeleton
                {
                    path: 'VueSkeleton',
                    name: 'VueSkeleton',
                    component: resolve => require(['@/pages/VueSkeleton'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // WebpackSkeleton
                {
                    path: 'WebpackSkeleton',
                    name: 'WebpackSkeleton',
                    component: resolve => require(['@/pages/WebpackSkeleton'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // SkeletonFile
                {
                    path: 'SkeletonFile',
                    name: 'SkeletonFile',
                    component: resolve => require(['@/pages/SkeletonFile'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // EntrySkeleton
                {
                    path: 'EntrySkeleton',
                    name: 'EntrySkeleton',
                    component: resolve => require(['@/pages/EntrySkeleton'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // ----------------工具类-----------------
                // wangEditor
                {
                    path: 'WangEditor',
                    name: 'WangEditor',
                    component: resolve => require(['@/tools/WangEditor'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueQuillEditor
                {
                    path: 'VueQuillEditor',
                    name: 'VueQuillEditor',
                    component: resolve => require(['@/tools/VueQuillEditor'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueMusic
                {
                    path: 'VueMusic',
                    name: 'VueMusic',
                    component: resolve => require(['@/tools/VueMusic'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueVideo
                {
                    path: 'VueVideo',
                    name: 'VueVideo',
                    component: resolve => require(['@/tools/VueVideo'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueCroppa
                {
                    path: 'VueCroppa',
                    name: 'VueCroppa',
                    component: resolve => require(['@/tools/VueCroppa'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueSwiper
                {
                    path: 'VueSwiper',
                    name: 'VueSwiper',
                    component: resolve => require(['@/tools/VueSwiper'], resolve)
                },
                // VueCountup
                {
                    path: 'VueCountup',
                    name: 'VueCountup',
                    component: resolve => require(['@/tools/VueCountup'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueVerify
                {
                    path: 'VueVerify',
                    name: 'VueVerify',
                    component: resolve => require(['@/tools/VueVerify'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueMap
                {
                    path: 'VueMap',
                    name: 'VueMap',
                    component: resolve => require(['@/tools/VueMap'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // Html2Canvas
                {
                    path: 'Html2Canvas',
                    name: 'Html2Canvas',
                    component: resolve => require(['@/tools/Html2Canvas'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // Html2Canvas
                {
                    path: 'VueLazyload',
                    name: 'VueLazyload',
                    component: resolve => require(['@/tools/VueLazyload'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueDragdrag
                {
                    path: 'VueDragdrag',
                    name: 'VueDragdrag',
                    component: resolve => require(['@/tools/VueDragdrag'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VuePowerDrag
                {
                    path: 'VuePowerDrag',
                    name: 'VuePowerDrag',
                    component: resolve => require(['@/tools/VuePowerDrag'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // VueDrr
                {
                    path: 'VueDrr',
                    name: 'VueDrr',
                    component: resolve => require(['@/tools/VueDrr'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // DraggableVue
                {
                    path: 'DraggableVue',
                    name: 'DraggableVue',
                    component: resolve => require(['@/tools/DraggableVue'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // 画布
                {
                    path: 'VueSignature',
                    name: 'VueSignature',
                    component: resolve => require(['@/tools/VueSignature'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // ------------ d3 -------------
                // svg
                {
                    path: 'VueSvg',
                    name: 'VueSvg',
                    component: resolve => require(['@/pages/VueSvg'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // ------------ http -------------
                // HttpCode
                {
                    path: 'HttpCode',
                    name: 'HttpCode',
                    component: resolve => require(['@/pages/HttpCode'], resolve),
                    meta: {
                        requireAuth: true
                    }
                },
                // 收藏
                {
                    path: 'Collect',
                    name: 'Collect',
                    component: resolve => require(['@/pages/collect/website'], resolve),
                    meta: {
                        requireAuth: true
                    }
                }
            ]
        }
    ]
})
